import variables from '@/assets/styles/element-variables.scss'
import defaultSettings from '@/settings'

const { showSettings, tagsView, fixedHeader, sidebarLogo } = defaultSettings

const state = {
  theme: variables.theme,
  showSettings: showSettings,
  tagsView: tagsView,
  fixedHeader: fixedHeader,
  sidebarLogo: sidebarLogo,
  //全选或全不选属性
  isCheckAll:"全选",
  //数据表格的高度
  tableHeight:window.document.body.clientHeight-300,
  //数据表格的宽度
  tableWidth:window.document.body.clientWidth-240,
  sexData:[{key:"0",label:"男"},{key:"1",label:"女"}]
}

const mutations = {
  CHANGE_SETTING: (state, { key, value }) => {
    if (state.hasOwnProperty(key)) {
      state[key] = value
    }
  },
  isCheckAll_setting:(state, value) => {
    state.isCheckAll = value
  }
}

const actions = {
  changeSetting({ commit }, data) {
    commit('CHANGE_SETTING', data)
  }
}

export default {
  namespaced: true,
  state,
  mutations,
  actions
}

